package com.example.zwx.myapplication;

import java.util.List;

/**
 * Created by Administrator on 2016/1/26.
 */
public class BleIRData {

    public static final int MODE_STR = 1;
    public static final int MODE_LIST = 2;

    public static final int PARSE_MODE_SELF = 0;
    public static final int PARSE_MODE_VENDOR = 1;

    public static final int DELAY_DEFAULT = 200;//默认发码间隔，单位毫秒

    public static final int ERR_GATT_DISCONNECTED = 1;
    public static final int ERR_GATT_BUSY = 2;
    public static final int ERR_UNKNOW = 3;

    private int ErrCode;

    private int mode;//1发送int数组，2发送String字符串，3发送List字符串

    private int parseMode = PARSE_MODE_SELF;//

    /**
     * 红外频率
     */
    private int freq;

    /**
     * 红外数据
     */
    private String pulse;

    private List<String> irDataList;

    /**
     * 时间戳
     */
    private long timeStamp;

    /**
     * 任务TAG
     */
    private String taskTag;


    /**
     * 发送耗时
     */
    private long duration;

    /**
     * 发送时是否需要压缩
     */
    private boolean needCompression = false;

    /**
     * 连续发码间隔
     */
    private int delay = DELAY_DEFAULT;

    private boolean sendSuccess = false;


    public BleIRData(int mode) {
        this.mode = mode;
    }


    public int getFreq() {
        return freq;
    }

    public String getPulse() {
        return pulse;
    }

    public void setPulse(String pulse) {
        this.pulse = pulse;
    }

    public void setFreq(int freq) {
        this.freq = freq;
    }

    public long getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(long timeStamp) {
        this.timeStamp = timeStamp;
    }

    public String getTaskTag() {
        return taskTag;
    }

    public void setTaskTag(String taskTag) {
        this.taskTag = taskTag;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public int getMode() {
        return mode;
    }

    public void setMode(int mode) {
        this.mode = mode;
    }

    public List<String> getIrDataList() {
        return irDataList;
    }

    public void setIrDataList(List<String> irDataList) {
        this.irDataList = irDataList;
    }

    public boolean isNeedCompression() {
        return needCompression;
    }

    public void setNeedCompression(boolean needCompression) {
        this.needCompression = needCompression;
    }

    public int getDelay() {
        return delay;
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }

    public boolean isSendSuccess() {
        return sendSuccess;
    }

    public void setSendSuccess(boolean sendSuccess) {
        this.sendSuccess = sendSuccess;
    }

    public int getErrCode() {
        return ErrCode;
    }

    public void setErrCode(int errCode) {
        ErrCode = errCode;
    }

    public int getParseMode() {
        return parseMode;
    }

    public void setParseMode(int parseMode) {
        this.parseMode = parseMode;
    }

    @Override
    public String toString() {
        return "BleIRData{" +
                "发送" + (sendSuccess ? "成功" : "失败") +
                ", 耗时=" + duration +
                "ms,ErrCode=" + ErrCode +
                '}';
    }
}
